package cn.me.alphamq.broker.netty.broker;

import cn.me.alphamq.common.event.EventBus;
import cn.me.alphamq.common.util.NettyUtil;

/**
 * broker 的服务端
 *
 * @author f
 */
public class BrokerServer {

    /**
     * broker 服务向外开放的端口
     */
    private final int port;

    public BrokerServer(int port) {
        this.port = port;
    }

    /**
     * 启动服务端
     */
    public void startServer() {
        NettyUtil.startNettyServer(
                port,
                "broker service",
                new BrokerServerHandler(new EventBus("broker-server-handle-task"))
        );
    }

}
